package org.csu.sei.entity.DTO;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.csu.sei.common.BaseConstant;
import org.csu.sei.entity.TeacherInfo;

import java.time.LocalDateTime;

@Data
public class BackTeacherInfoItemDTO {
    private Long id;
    @JSONField(name="employee_number")
    private String employeeNumber;
    private String name;
    private String img;
    @JSONField(name="create_time")
    private LocalDateTime createTime;
    @JSONField(name="update_time")
    private LocalDateTime updateTime;

    public BackTeacherInfoItemDTO(){};
    public BackTeacherInfoItemDTO(TeacherInfo teacherInfo){
        this.id = teacherInfo.getId();
        this.employeeNumber = teacherInfo.getEmployeeNumber();
        this.name = teacherInfo.getName();
        this.img = teacherInfo.getImg();
        this.createTime = teacherInfo.getCreateTime();
        this.updateTime = teacherInfo.getUpdateTime();
    }

    public static BackTeacherInfoItemDTO returnBackTeacherInfoItemDTO(TeacherInfo teacherInfo){
        return new BackTeacherInfoItemDTO(teacherInfo);
    }
}
